package com.zjxf.resource;

import com.alibaba.fastjson.JSONObject;
import com.zjxf.base.common.OperationException;

import javax.servlet.http.HttpServletRequest;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 *
 * @author zhanghao
 * date: 2019/2/21 13:56
 * description:
 */
public interface ResourceManagerInterfaceService {


    /**
     * 上载文件
     *
     * @param request request
     * @param param   请求参数
     * @return String
     */
    String uploadFile(JSONObject param, HttpServletRequest request) throws Exception;

    /**
     * 上载文件(无参)
     *
     * @param request request
     * @return String
     */
    String uploadFile(HttpServletRequest request) throws Exception;

    /**
     * 上载文件(无参)
     *
     * @param request request
     * @return String
     */
    String uploadFiles(HttpServletRequest request) throws Exception;

    /**
     * 查询文件信息
     *
     * @param params 参数
     * @return String
     */
    Object findFileInfo(JSONObject params) throws OperationException;

    /**
     * 修改文件名称
     *
     * @param params 参数
     */
    void updateFileName(JSONObject params);

    /**
     * 下载文件
     *
     * @param params 参数
     * @param out    响应流
     */
    void downFile(JSONObject params, OutputStream out) throws Exception;

    /**
     * 在线打开文件
     *
     * @param request 参数
     * @return String
     * @throws OperationException 自定义异常
     */
    String onLineFile(HttpServletRequest request, String md5) throws OperationException, OperationException;


}
